<template>
	<view class="content">
		<detail-item :options="buldingInfo"></detail-item>
		<view class="cu-bar bg-white margin-top">
			<view class="action"><text class="cuIcon-titles text-red"></text>基本参数</view>
		</view>
		<!-- <view class="cu-list bg-white">
			<view class="cu-item solid-bottom " v-if="buldingInfo.zongjia!=''&&buldingInfo.zongjia!=null"><text class="text-grey">楼盘总价：</text>{{buldingInfo.zongjia}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.housetype!=''&&buldingInfo.housetype!=null"><text class="text-grey">楼盘类型：</text>{{buldingInfo.housetype}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.mianji!=''&&buldingInfo.mianji!=null"><text class="text-grey">占地面积：</text>{{buldingInfo.mianji}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.gongtan!=''&&buldingInfo.gongtan!=null"><text class="text-grey"> 公摊面积：</text>{{buldingInfo.gongtan}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.jiaofu!=''&&buldingInfo.payway!=null"><text class="text-grey">支付方式：</text>{{buldingInfo.payway}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.zongjia!=''&&buldingInfo.jiaofu!=null"><text class="text-grey">交付标准：</text>{{buldingInfo.jiaofu}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.opensaletime!=''&&buldingInfo.opensaletime!=null"><text class="text-grey">物业公司：</text>{{buldingInfo.opensaletime}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.tongqi!=''&&buldingInfo.tongqi!=null"><text class="text-grey">是否通气：</text>{{buldingInfo.tongqi}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.cenggao!=''&&buldingInfo.cenggao!=null"><text class="text-grey">层高：</text>{{buldingInfo.cenggao}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.cenghubi!=''&&buldingInfo.cenghubi!=null"><text class="text-grey">层户比：</text>{{buldingInfo.cenghubi}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.wuyefei!=''&&buldingInfo.wuyefei!=null"><text class="text-grey">物业费：</text>{{buldingInfo.wuyefei}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.staytime!=''&&buldingInfo.staytime!=null"><text class="text-grey">入驻时间：</text>{{buldingInfo.staytime}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.fxmoney!=''&&buldingInfo.fxmoney!=null"><text class="text-grey">佣金：</text>{{buldingInfo.fxmoney}}</view>
		</view> -->
		
		<view class="cu-list bg-white">
			<view class="cu-item solid-bottom " v-if="buldingInfo.price!=''&&buldingInfo.price!=null"><text class="text-grey">单价：</text>{{buldingInfo.price}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.houseprice!=''&&buldingInfo.houseprice!=null"><text class="text-grey">均价：</text>{{buldingInfo.houseprice}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.housearea!=''&&buldingInfo.housearea!=null"><text class="text-grey">面积区间：</text>{{buldingInfo.housearea}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.zongjia!=''&&buldingInfo.zongjia!=null"><text class="text-grey">总价区间：</text>{{buldingInfo.zongjia}}</view>
			
			<view class="cu-item solid-bottom " v-if="buldingInfo.mianji!=''&&buldingInfo.mianji!=null"><text class="text-grey">占地面积：</text>{{buldingInfo.mianji}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.onSaleType!=''&&buldingInfo.onSaleType!=null"><text class="text-grey"> 在售业态：</text>{{buldingInfo.onSaleType}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.tongqi!=''&&buldingInfo.tongqi!=null"><text class="text-grey">是否通气：</text>{{buldingInfo.tongqi}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.onSaleProduct!=''&&buldingInfo.onSaleProduct!=null"><text class="text-grey">在售产品：</text>{{buldingInfo.onSaleProduct}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.onSaleCount!=''&&buldingInfo.onSaleCount!=null"><text class="text-grey">可售套数：</text>{{buldingInfo.onSaleCount}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.zongCengShu!=''&&buldingInfo.zongCengShu!=null"><text class="text-grey">总层数：</text>{{buldingInfo.zongCengShu}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.cenghubi!=''&&buldingInfo.cenghubi!=null"><text class="text-grey">梯户比：</text>{{buldingInfo.cenghubi}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.cenggao!=''&&buldingInfo.cenggao!=null"><text class="text-grey">层高：</text>{{buldingInfo.cenggao}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.year!=''&&buldingInfo.year!=null"><text class="text-grey">产权年限：</text>{{buldingInfo.year}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.opensaletime!=''&&buldingInfo.opensaletime!=null"><text class="text-grey">物管公司：</text>{{buldingInfo.opensaletime}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.wuyefei!=''&&buldingInfo.wuyefei!=null"><text class="text-grey">物业费：</text>{{buldingInfo.wuyefei}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.rongJiLv!=''&&buldingInfo.rongJiLv!=null"><text class="text-grey">容积率：</text>{{buldingInfo.rongJiLv}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.housegreenrate!=''&&buldingInfo.housegreenrate!=null"><text class="text-grey">绿化率：</text>{{buldingInfo.housegreenrate}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.gongtan!=''&&buldingInfo.gongtan!=null"><text class="text-grey">公摊：</text>{{buldingInfo.gongtan}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.shangGuan!=''&&buldingInfo.shangGuan!=null"><text class="text-grey">商管公司：</text>{{buldingInfo.shangGuan}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.staytime!=''&&buldingInfo.staytime!=null"><text class="text-grey">入驻时间：</text>{{buldingInfo.staytime}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.jiaoFangShiJian!=''&&buldingInfo.jiaoFangShiJian!=null"><text class="text-grey">交房时间：</text>{{buldingInfo.jiaoFangShiJian}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.cheWeiBi!=''&&buldingInfo.cheWeiBi!=null"><text class="text-grey">车位比：</text>{{buldingInfo.cheWeiBi}}</view>
			<view class="cu-item solid-bottom " v-if="buldingInfo.fxmoney!=''&&buldingInfo.fxmoney!=null"><text class="text-grey">佣金：</text>{{buldingInfo.fxmoney}}</view>
		</view>
		
		<view class="cu-bar bg-white margin-top">
			<view class="action"><text class="cuIcon-titles text-red"></text>楼盘简介</view>
		</view>
		<view class="detail-info bg-white">
				<rich-text class="content" :nodes="buldingInfo.content" style="padding: 10px;"></rich-text>
		</view>
		
	</view>
</template>

<script>
	import detailItem from './detail-item.vue';
	export default {
		components: {
			detailItem
		},
		data() {
			return {
					id:0,
				    buldingInfo:{
					}
				}
			},
				onLoad(e) {
					this.id=e.id;
					this.loadDetailInfo();
				},
				onShareAppMessage(){
					return {
					      title: '选楼盘，查佣金，看房价'
					    }
				},
				methods: {
					loadDetailInfo(){
						var me=this;
						uni.request({
							url: me.$rootUrl+'/House/Find',
							data: {id:me.id},
							method: 'GET',
							success(res) {	
								if (res.data.success) {
									me.buldingInfo=res.data.data;
								} else {
									uni.showModal({
										content: '服务器错误!',
										showCancel: false
									});
								}
							},
							fail() {
								uni.showModal({
									content: me.connectionFailText,
									showCancel: false
								});
							}
						});
					},
					
				}
			}
	
</script>

<style lang="scss">
	.content{
		
		.cu-list{
			margin-top:4px;
			
			
			.cu-item{
					padding:10px 15px;
					.text-white{
						font-size: 30px;
						background-color:#007AFF;
						color: white;
						border-radius: 40%;
						height: 50px;
						line-height: 50px;
					}
			}
			
		}
		.detail-info{
			margin-top:4px;
			padding:10px 15px;
		}
		.bottom{
				position: fixed;
				bottom:0;
				display: flex;
				flex-direction: row;
				padding: 10px 0;
				width:100%;
				background:white;
				text-align: center;
				border-top:gray 1px solid;
				button{
					font-size: 30upx;
					
					color:white;
					width:40%;	
				}
			} 	
	}
</style>
